export default {
  currentProdcut: null,
  imgPrefix:
    process.env.NODE_ENV === 'development'
      ? 'https://youxiang-server-1256354707.cos.ap-beijing.myqcloud.com/image/'
      : 'https://cos.ue-link.cn/image/',

  setUserInfo(value) {
    if (value) localStorage.setItem('userInfo', JSON.stringify(value))
    else localStorage.setItem('userInfo', value)
  },
  getUserInfo() {
    const userInfo = localStorage.getItem('userInfo')
    if (!userInfo) {
      return {
        token: '',
        customerID: '-1',
        userCode: ''
      }
    }
    return JSON.parse(userInfo)
  },
  setPageStatus(value) {
    localStorage.setItem('pageStatus', value)
  },
  getPageStatus() {
    return localStorage.getItem('pageStatus')
  }
}
